package com.dmw.controller;

import com.dmw.dto.Dto;
import com.dmw.service.ScheduleConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(value = "scheduler/api")
public class ScheduleController {
    @Autowired
    private ScheduleConsumerService scheduleConsumerService;

    /**
     * 选座页API 2-1 根据剧场Id查询剧场原始座位
     * @param map
     * @return
     */
    @PostMapping("/p/queryOriginalCinemaSeatArray")
    public Dto queryOriginalCinemaSeatArray(@RequestBody Map<String, Object> map){
        System.out.println(">>>根据剧场Id查询剧场原始座位");

        System.out.println(map.get("scheduleId"));
        System.out.println(map.get("cinemaId"));

        return scheduleConsumerService.queryOriginalCinemaSeatArray(map);
    }

    /**
     * 选座页API 2-2  根据排期获取剧场座位信息
     * @param map
     * @return
     */
    @PostMapping("/p/queryCinemaSeatArrayByScheduleId")
    public Dto queryCinemaSeatArrayByScheduleId(@RequestBody Map<String, Object> map) {

        System.out.println(map.get("scheduleId"));
        System.out.println(map.get("cinemaId"));

        return scheduleConsumerService.queryCinemaSeatArrayByScheduleId(map);

    }

}
